/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package processor;

/**
 *
 * @author Dat
 */
public class KeyWord {
    private String s;
    
    public KeyWord(){
        s = null;
    }
    
    public KeyWord(String s){
        this.s = s;
    }
    
    public String changKeyWordToLowerCase(){
        String r = s.trim();
        String temp = r.toLowerCase();
        
        for(int i = 0; i < Constant.KEY_WORD.length; i++){
            String keyword = Constant.KEY_WORD[i];
            int pos = 0;
            while(true){
                pos = temp.indexOf(keyword, pos);
                if(pos == -1){
                    break;
                }
                r = r.substring(0, pos) + 
                        r.substring(pos, pos + keyword.length()).toLowerCase() + 
                        r.substring(pos + keyword.length(), r.length());
                pos ++;
            }
        }
        
        return r;
    }
}
